<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">库存预警</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-12">
                <div class="alert alert-warning">
                    <i class="fa fa-exclamation-triangle"></i> 以下物料库存不足，请及时补充。
                </div>
            </div>
        </div>
        
        <div class="row">
            <div class="col-md-12">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>物料编码</th>
                            <th>物料名称</th>
                            <th>物料分类</th>
                            <th>仓库</th>
                            <th>当前库存</th>
                            <th>最小库存</th>
                            <th>最大库存</th>
                            <th>预警状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $list as $item}
                        <tr>
                            <td>{$item.material.material_code}</td>
                            <td>{$item.material.material_name}</td>
                            <td>{$item.material.category.name}</td>
                            <td>{$item.warehouse.warehouse_name}</td>
                            <td>
                                <span class="label label-{$item.warning_status_color}">{$item.quantity}</span>
                            </td>
                            <td>{$item.material.min_stock}</td>
                            <td>{$item.material.max_stock}</td>
                            <td>
                                <span class="label label-{$item.warning_status_color}">{$item.warning_status_text}</span>
                            </td>
                            <td>
                                <a href="manufacture/stock/inbound?id={$item.id}" class="btn btn-success btn-xs">
                                    <i class="fa fa-sign-in"></i> 入库
                                </a>
                                <a href="manufacture/material/detail?id={$item.material.id}" class="btn btn-info btn-xs">
                                    <i class="fa fa-eye"></i> 详情
                                </a>
                            </td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
        
        {if empty($list)}
        <div class="row">
            <div class="col-md-12">
                <div class="alert alert-success">
                    <i class="fa fa-check-circle"></i> 当前没有库存预警，所有物料库存充足。
                </div>
            </div>
        </div>
        {/if}
    </div>
</div>
